package com.guapi.entity;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;

import java.util.Date;

@Data
public class User {
    private int id;
    private String userName;
    private String password;
    private String salt;
    private String email;
    private String address;
    private String headerUrl;
    private String activationCode;

    private Date createTime;
    //用户状态：‘0-可用状态/(已激活)---1-不可用状态(未激活)---2不可用状态(封禁)’
    @Value("1")
    private int status;
    //用户类型：‘0-普通用户（默认为买家）---1-卖家---2-管理员’
    //此处是否有必要设置买家和卖家的区分？
    @Value("0")
    private int type;

    public void setId(int id) {
        if (id==0){
            return;
        }else {
            this.id=id;
        }
    }
}
